package com.xiaoyi.library.mapper;

import com.xiaoyi.library.pojo.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {

//    @Select("SELECT * FROM user WHERE userName = #{userName}")
//    User findByName(@Param("userName") String userName);

    @Insert("INSERT INTO user (user_name,user_email, user_password, user_role, user_status) VALUES (#{user_name},#{user_email}, #{user_password}, 'USER', '0')")
    boolean insert(User user);
    @Select("SELECT * FROM user WHERE user_name = #{user_name} AND user_password = #{user_password}")
    boolean findByUsernameAndPassword(@Param("user_name") String user_name, @Param("user_password") String user_password);
}
